package entity;

import java.io.Serializable;
import javax.persistence.*;
import javax.validation.constraints.NotNull;

import java.util.Date;


/**
 * The persistent class for the person database table.
 * 
 */
@Entity
@Table(name="person")
public class Person implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@Column(name="id_user")
	private Integer idUser;

	@NotNull(message="informe sua data de nascimento")
    @Temporal( TemporalType.DATE)
	private Date birthdate;

	@NotNull(message="informe seu gênero")
	private String gender;

	@NotNull(message="informe seu nome")
	private String name;

	@NotNull(message="informe seu sobrenome")
	private String surname;

	//bi-directional one-to-one association to User
	@OneToOne
	@JoinColumn(name="id_user", insertable=false, updatable=false)
	private User user;

    public Person() {
    }

	public Integer getIdUser() {
		return this.idUser;
	}

	public void setIdUser(Integer idUser) {
		this.idUser = idUser;
	}

	public Date getBirthdate() {
		return this.birthdate;
	}

	public void setBirthdate(Date birthdate) {
		this.birthdate = birthdate;
	}

	public String getGender() {
		return this.gender;
	}

	public void setGender(String gender) {
		this.gender = gender;
	}

	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getSurname() {
		return this.surname;
	}

	public void setSurname(String surname) {
		this.surname = surname;
	}

	public User getUser() {
		return this.user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	
}